import request from '@/utils/request'

// 创建出库记录
export function createOutbound(data) {
  return request({
    url: '/ems/outbound/create',
    method: 'post',
    data: data
  })
}

// 更新出库记录
export function updateOutbound(data) {
  return request({
    url: '/ems/outbound/update',
    method: 'put',
    data: data
  })
}

// 删除出库记录
export function deleteOutbound(id) {
  return request({
    url: '/ems/outbound/delete?id=' + id,
    method: 'delete'
  })
}

// 获得出库记录
export function getOutbound(id) {
  return request({
    url: '/ems/outbound/get?id=' + id,
    method: 'get'
  })
}

// 获得出库记录分页
export function getOutboundPage(query) {
  return request({
    url: '/ems/outbound/page',
    method: 'get',
    params: query
  })
}

// 导出出库记录 Excel
export function exportOutboundExcel(query) {
  return request({
    url: '/ems/outbound/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

// 删除出库信息
export function deleteInfo(id) {
  return request({
    url: '/ems/outbound/deleteInfo?id=' + id,
    method: 'delete'
  })
}


// 批量创建出库记录
export function insertBatchInfo(data) {
  return request({
    url: '/ems/outbound/insertBatchInfo',
    method: 'post',
    data: data
  })
}

// 更新出库信息
export function updateInfo(data) {
  return request({
    url: '/ems/outbound/updateInfo',
    method: 'put',
    data: data
  })
}